home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 1489 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.5 KB  |  58 lines

  1. Path: fch.wimsey.bc.ca!fch!dan
  2. From: dan@fch.wimsey.bc.ca (Dan Fandrich)
  3. Newsgroups: comp.sys.cbm
  4. Subject: Re: Want to read/record temp with c64
  5. Distribution: world
  6. Message-ID: <310cb9df.195sn@fch.wimsey.bc.ca>
  7. Date: Mon, 29 Jan 1996 04:13:19 -0800
  8. References: <4e75jl$je4@news.csus.edu>
  9. Organization: Fandrich Cone Harvesters Ltd.
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=ISO-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Newsreader: Simple News 1.92 [alpha4] (DOS)
  14. X-Posting-Software: UUPC/extended 1.12i inews (15Mar94 08:36)
  15.  
  16. In article <4e75jl$je4@news.csus.edu> mrubin@gallium writes:
  17. >I would like to hook up a sensor to one of my spare c64s to read and
  18. >record outside temperatures.
  19. >
  20. >I can probably handle the programming, but what do I need to do the
  21. >sensing and where would I wire it in?
  22. >
  23. >Anyone done this before?
  24.  
  25. I've done this before using thermisters connected to a PC's game port and
  26. gotten accuracy to better than +/- 0.5 ░C.  I don't see why this wouldn't
  27. work on a C64 by connecting them to the paddle ports.  Here's part of
  28. the documentation I wrote for the PC project:
  29.  
  30.        To obtain  accurate  results in  the range of about  10 ░C
  31.        to 40 degrees C, thermistors with a nominal resistance  of
  32.        about  100  kilohms  at  25 degrees should be used, with a
  33.        temperature coefficient of  about  -4  %/degree,  such  as
  34.        Digi-Key  part  number KC013G or KC006T.  A small resistor
  35.        (e.g. 50 ohms) can be placed  in  series  with  the  power
  36.        leads  to  limit  current  flow from the game port card in
  37.        case of a short.  The value of the resistor can be  nulli-
  38.        fied in the calibration stage.
  39.  
  40. The safety resistor shouldn't be necessary on the C64 because of the
  41. different design of the paddle port.  You will need to determine a
  42. mapping from the paddle port values to resistance in ohms (it's linear
  43. on a PC; if it isn't on a 64, it ought to be).  Then use the following
  44. equation to get a temperature:
  45.  
  46.        For the thermistors, these values are d and c in the equa-
  47.        tion  t(r)=c+ln(100000)/s-ln(r)/s,  where r is the  resis-
  48.        tance of the thermistor  in ohms and t is its temperature.
  49.        Practically, d is the proportional  resistance  change  in
  50.        ohms at 100 kilohms, and c is the temperature of the ther-
  51.        mistor in degrees Celsius at 100 kilohms.  For  the  ther-
  52.        mistors used in the lab, d is approximately 0.047 and c is
  53.        approximately 25.
  54.  
  55. >>> Dan
  56. -- 
  57. dan@fch.wimsey.bc.ca / MIME email ok / finger danf@vanbc.wimsey.com for pgp key
  58.